/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package minesweeper;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JToggleButton;

/**
 *
 * @author grostirolla
 */
public class DefaultAction implements ActionListener {

    MazeView maze;

    @Override
    public void actionPerformed(ActionEvent e) {
        if (!maze.endOfGame()) {
            maze.setrPressed(((mazeButton) e.getSource()).getY_());
            maze.setcPressed(((mazeButton) e.getSource()).getX_());
            //maze.checkNeighborhood();
            maze.checkClick();
        }
    }

    public void setMazeView(MazeView maze) {
        this.maze = maze;
    }
}
